
package cartoon.room;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;

import java.util.List;




public class CartoonHistoryViewModel extends AndroidViewModel {
    private CartoonRxJava rxJavaThread;


    public CartoonHistoryViewModel(@NonNull Application application) {
        super(application);


        rxJavaThread = CartoonRxJava.getInstance(getApplication());
    }

    public void addHistoryDao(CartoonHistoryModel historyModel) {
        rxJavaThread.addHistoryDao(historyModel);
    }

    public void addsHistoryDao(CartoonHistoryModel... historyModels) {
        rxJavaThread.addsHistoryDao(historyModels);
    }


    public void deleteHistory(CartoonHistoryModel... historyModels) {
        rxJavaThread.deleteHistory(historyModels);
    }

    public void updateHistory(CartoonHistoryModel... historyModels) {
        rxJavaThread.updateHistory(historyModels);
    }


//    public HistoryModel getHistoryId(Integer id) {
////        return historyDao.getHistoryId(id);
//        return rxJavaThread.getHistoryId(id);
//    }

    public void deleteTableData() {
        rxJavaThread.deleteTableData();

    }

    public LiveData<List<CartoonHistoryModel>> getAllSLive() {
        return rxJavaThread.getAllSLive();
    }
}
